package io.github.talelin.latticy.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.github.talelin.latticy.bo.StockBO;
import io.github.talelin.latticy.dto.stock.StockAdjustDTO;
import io.github.talelin.latticy.dto.stock.StockDTO;
import io.github.talelin.latticy.dto.stock.StockPageDTO;
import io.github.talelin.latticy.dto.stock.StockVO;
import io.github.talelin.latticy.model.StockDO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * <p>
 * 库存 服务类
 * </p>
 *
 * @author generator@wulongbo
 * @since 2022-06-28
 */
public interface StockService extends IService<StockDO> {

    IPage<StockVO> getStockList(StockPageDTO stockPageDTO);

    /**
     * 根据 仓库编码、客户代码、sku查询唯一
     *
     * @param warehouseCode
     * @param customerCode
     * @param sku
     * @return
     */
    StockDO getStockByWarehouseCodeAndCustomerCodeAndSku(String warehouseCode, String customerCode, String sku);


    /**
     * 审核入库单保存
     *
     * @param stockDTO
     * @return
     */
    Boolean insertOrUpStock(StockDTO stockDTO);

    /**
     * 库存消息投递
     * @param stockBOS
     */
    void deliveryOnTheWayStock(List<StockBO> stockBOS);

    boolean adjustStock(List<StockAdjustDTO> stockDTO);
}
